class GenRepository
	attr_accessor :chromosome_sample
	attr_accessor :instance
		
	def self.instance
		 if @instance.nil? then
			@instance = GenRepository.new
		else
			@instance
		end
	end

	def get_chromosome()
		new_chromosome = chromosome_sample.clone
#		new_chromosome = Marshal.load(Marshal.dump(chromosome_sample))
		new_chromosome.gens = chromosome_sample.gens.map{|gen| gen.clone}
#solo compuesto
		if new_chromosome.gens.first.gens_amount > 1 then
			new_chromosome.gens.each{|gen| gen.gens = gen.gens.map{|sg| sg.clone}}
		end
#comp
		new_chromosome.gens.each{|gen| gen.set_allele}
		return new_chromosome
	end
end
